
#line 1 "main.rl"
//https://www.cnblogs.com/baiihcy/p/5414875.html
#include <stdio.h>
#include <string.h>


#line 9 "main.c"
static const char _foo_actions[] = {
	0, 1, 0, 1, 1, 1, 2
};

static const char _foo_key_offsets[] = {
	0, 0, 2, 3, 4, 5, 6, 7, 
	8, 9, 9, 10
};

static const char _foo_trans_keys[] = {
	102, 116, 108, 115, 101, 0, 117, 101, 
	0, 97, 114, 0
};

static const char _foo_single_lengths[] = {
	0, 2, 1, 1, 1, 1, 1, 1, 
	1, 0, 1, 1
};

static const char _foo_range_lengths[] = {
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0
};

static const char _foo_index_offsets[] = {
	0, 0, 3, 5, 7, 9, 11, 13, 
	15, 17, 18, 20
};

static const char _foo_trans_targs[] = {
	10, 11, 9, 3, 0, 4, 0, 5, 
	0, 9, 0, 7, 0, 8, 0, 9, 
	0, 0, 2, 0, 6, 0, 0
};

static const char _foo_trans_actions[] = {
	5, 5, 5, 0, 0, 0, 0, 0, 
	0, 3, 0, 0, 0, 0, 0, 1, 
	0, 0, 0, 0, 0, 0, 0
};

static const int foo_start = 1;
static const int foo_first_final = 9;
static const int foo_error = 0;

static const int foo_en_main = 1;


#line 24 "main.rl"



int GetRes(char *pbuf)
{
    int res2;
    char *p=pbuf; //初始化 p 指向需要做 FSM 处理的数组起始地址
    char *pe=p+strlen(pbuf)+1; //初始化 pe 指向 p 的结束地址
    int cs; // cs 用来保存 FSM 运行中状态

    //写入初始化代码
    
#line 71 "main.c"
	{
	cs = foo_start;
	}

#line 36 "main.rl"

    //写入执行代码
    
#line 80 "main.c"
	{
	int _klen;
	unsigned int _trans;
	const char *_acts;
	unsigned int _nacts;
	const char *_keys;

	if ( p == pe )
		goto _test_eof;
	if ( cs == 0 )
		goto _out;
_resume:
	_keys = _foo_trans_keys + _foo_key_offsets[cs];
	_trans = _foo_index_offsets[cs];

	_klen = _foo_single_lengths[cs];
	if ( _klen > 0 ) {
		const char *_lower = _keys;
		const char *_mid;
		const char *_upper = _keys + _klen - 1;
		while (1) {
			if ( _upper < _lower )
				break;

			_mid = _lower + ((_upper-_lower) >> 1);
			if ( (*p) < *_mid )
				_upper = _mid - 1;
			else if ( (*p) > *_mid )
				_lower = _mid + 1;
			else {
				_trans += (unsigned int)(_mid - _keys);
				goto _match;
			}
		}
		_keys += _klen;
		_trans += _klen;
	}

	_klen = _foo_range_lengths[cs];
	if ( _klen > 0 ) {
		const char *_lower = _keys;
		const char *_mid;
		const char *_upper = _keys + (_klen<<1) - 2;
		while (1) {
			if ( _upper < _lower )
				break;

			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
			if ( (*p) < _mid[0] )
				_upper = _mid - 2;
			else if ( (*p) > _mid[1] )
				_lower = _mid + 2;
			else {
				_trans += (unsigned int)((_mid - _keys)>>1);
				goto _match;
			}
		}
		_trans += _klen;
	}

_match:
	cs = _foo_trans_targs[_trans];

	if ( _foo_trans_actions[_trans] == 0 )
		goto _again;

	_acts = _foo_actions + _foo_trans_actions[_trans];
	_nacts = (unsigned int) *_acts++;
	while ( _nacts-- > 0 )
	{
		switch ( *_acts++ )
		{
	case 0:
#line 9 "main.rl"
	{ 
        res2=1;
    }
	break;
	case 1:
#line 12 "main.rl"
	{
        res2=0;    
    }
	break;
	case 2:
#line 15 "main.rl"
	{
        res2=-1;
    }
	break;
#line 171 "main.c"
		}
	}

_again:
	if ( cs == 0 )
		goto _out;
	if ( ++p != pe )
		goto _resume;
	_test_eof: {}
	_out: {}
	}

#line 39 "main.rl"
    return res2;
}

int main()
{
    int cs4;
    char buf[256];
    while (scanf("%s",buf)) {
        printf("res=%d\n",GetRes(buf));
    }
    return 0;
}
